﻿using AutoMapper;
using Domain.Entity;
using Domain.Entity.tr;
using Domain.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.Allot_dService
{
    public class Allot_dService : IAllot_dService
    {
        private readonly IAllot_dRepository Allot_dRepository;
        private readonly IMapper mapper;
        public Allot_dService(IAllot_dRepository Allot_dRepository, IMapper mapper)
        {
            this.Allot_dRepository = Allot_dRepository;
            this.mapper = mapper;
        }

        public Task<List<Allot_d>> GetAid(int[] ids)
        {
            throw new NotImplementedException();
        }

        public Task<List<Allot_d>> GetAll()
        {
            throw new NotImplementedException();
        }

        public async Task<List<Allot_d>> GetAllot_d(int id)
        {
            return await Allot_dRepository.GetAllot_d(id);
        }

        //统计调拨
        public async Task<FenYe<AllotTJResult>> GetAllotTJResult(FenYe<AllotTJResult> fenYe, string? proc_code, string? al_code, string? al_type, string? header_create_by, int? type_id, string? proc_primary_unit, string? al_user, int? out_wh_id, int? in_wh_id, int[] instock_status, int[] outstock_status, string? startTime, string? endTime, string? createstartTime, string? createendTime)
        {
            return await Allot_dRepository.GetAllotTJResult(fenYe, proc_code, al_code, al_type, header_create_by, type_id, proc_primary_unit, al_user, out_wh_id, in_wh_id, instock_status, outstock_status, startTime, endTime, createstartTime, createendTime);
        }

        public async Task<int> UpdateStatus(string nameok, int oknum, string nameno, int nonum, string name, int alid, int procid)
        {
            return await Allot_dRepository.UpdateStatus(nameok, oknum, nameno, nonum, name, alid, procid);
        }
    }
}
